import Cookies from 'js-cookie'

const TokenKey = 'HRSAAS_USER_TOKEN' // 存储token
const TimeKey = 'HRSAAS_TIMESTAMP_KEY' // 存储token时间戳
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 挂载存储、读取时间戳的方法
export function getTimeStamp() {
  return Cookies.get(TimeKey)
}
export function setTimeStamp(currentTime) {
  return Cookies.set(TimeKey, currentTime)
}
